/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mop.dinnerbook.dao;

import com.mop.dinnerbook.bean.Department;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author Huge Laurie
 * 子项目组业务类
 */
public class DepartmentDAO extends BaseDAO{
    /*
     获取所有子项目组
     */
    public List getAllDepartment(){
        List result = null;
        String sql="select did,dname,remark from department order by did";
        try {
                result = executeSelectList(sql, new Processor(){
                        @Override
                        public Object product(ResultSet rst) throws SQLException{
                                Department depart = new Department();
                                depart.setDid(rst.getInt(1));
                                depart.setDname(rst.getString(2)); 
                                depart.setRemark(rst.getString(3));
                                return depart;
                        }
                });
        } catch (SQLException e) {
                System.out.println(sql);
                e.printStackTrace();
        }
        return result;
    }
}
